<!DOCTYPE html>
<html lang="en">
    <head>
        <meta charset="UTF-8">
        <title>p5_元素消失</title>
        <style>
            div{
                width: 200px;
                height: 200px;
                border: 5px solid #000;
            }
            .d1{
                background-color: #f00;
            }
            .d1:hover{
                /*缩小到看不见 并不会释放布局空间*/
                transform: scale(0);
            }
            .d2{
                background-color: #0f0;
            }
            .d2:hover{
                /*元素显示模式会消失 并会释放布局空间*/
                display: none;
            }
            .d3{
                background-color: #00f;
            }

        </style>
    </head>
    <body>
        <div class="d1">1</div>
        <div class="d2">2</div>
        <div class="d3">3</div>
    </body>
</html>